What is a Dynamic way to Connect to a Virtual Machine's Webserver from its Host Machine? [closed]

Posted by Jonnybojangles on Super User See other posts from Super User or by Jonnybojangles
Published on 2012-10-30T20:59:32Z Indexed on 2012/11/01 17:06 UTC
Read the original article Hit count: 191

Filed under:
|
|
|
|

As a Web-Developer what is the most efficient (automated) way to connect to a Virtual Machine (VM) running a development webserver from it’s Host Machine (the machine running the VM) when you do not have control over the networks (home, Startbucks, work, etc) you are connected to?

Currently I start my VM (a VirtualBox VM running CentOS), run ifconfig to determine the VM’s current IP. I then take that IP and map it my Host machine’s host file so that I can access the VM’s webserver from the Host.

I feel that this is not an efficient way to connect to my VM’s webserver because each time I connect to a new network (a few times a day) I need to repeat the IP look up and host file update, and sometimes restart the VM's network service.

© Super User or respective owner

Related posts about virtual-machine

Related posts about dns